<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>par_kinematics: /home/wouter/ros_packages/thp-pj2-08/par_kinematics/include/par_kinematics/util.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>

<table border="0">
<tr><td valign="top" style="border-right: 1px solid #333; padding-right: 10px;" >
<p>
Project: <a href="http://ros.org/wiki/par_kinematics">par_kinematics</a>
</p>
<p>
License: BSD
</p>
<p>
Dependencies: 
<ul>
  <li>std_msgs</li>
  <li>roscpp</li>
  <li>par_trajectory_planning</li>
</ul>
</p>
<p>
Used by:
None<br />
</p>
<p>
<a href="../../index.html">All Packages</a>
</p>

</div>
</td><td valign="top" style="padding-left: 10px;" >
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>/home/wouter/ros_packages/thp-pj2-08/par_kinematics/include/par_kinematics/util.h</h1>  </div>
</div>
<div class="contents">
<a href="util_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;ros/ros.h&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;cmath&gt;</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="preprocessor">#ifndef _UTIL_H_</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define _UTIL_H_</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a><a class="code" href="util_8h.html#a598a3330b3c21701223ee0ca14316eca">00014</a> <span class="preprocessor">#define PI 3.14159265358979323846</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a><a class="code" href="classUtil.html">00016</a> <span class="keyword">class </span><a class="code" href="classUtil.html">Util</a> 
<a name="l00017"></a>00017 {
<a name="l00018"></a>00018                 <span class="keyword">public</span>:
<a name="l00024"></a><a class="code" href="classUtil.html#afdc08f7d944cb35d3360f5ae5478d8af">00024</a>                         <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="classUtil.html#afdc08f7d944cb35d3360f5ae5478d8af" title="Function for converting radians to degrees.">deg</a>(<span class="keywordtype">double</span> <a class="code" href="classUtil.html#a96a574ae5971d45cc92cbc19677cbe5d" title="Function for converting degrees to radians.">rad</a>) 
<a name="l00025"></a>00025                         {
<a name="l00026"></a>00026                                 <span class="keywordflow">return</span> double(rad/<a class="code" href="util_8h.html#a598a3330b3c21701223ee0ca14316eca">PI</a>*180);
<a name="l00027"></a>00027                         }
<a name="l00033"></a><a class="code" href="classUtil.html#a96a574ae5971d45cc92cbc19677cbe5d">00033</a>                         <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="classUtil.html#a96a574ae5971d45cc92cbc19677cbe5d" title="Function for converting degrees to radians.">rad</a>(<span class="keywordtype">double</span> <a class="code" href="classUtil.html#afdc08f7d944cb35d3360f5ae5478d8af" title="Function for converting radians to degrees.">deg</a>) 
<a name="l00034"></a>00034                         {
<a name="l00035"></a>00035                                 <span class="keywordflow">return</span> double(deg/180*<a class="code" href="util_8h.html#a598a3330b3c21701223ee0ca14316eca">PI</a>);
<a name="l00036"></a>00036                         }
<a name="l00042"></a><a class="code" href="classUtil.html#add5e057769841913daa68836e6fd2790">00042</a>                         <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classUtil.html#add5e057769841913daa68836e6fd2790" title="Function for checking validity of a number.">isNaN</a>(<span class="keywordtype">double</span> x) 
<a name="l00043"></a>00043                         {
<a name="l00044"></a>00044                                 <span class="keywordflow">return</span> x != x;
<a name="l00045"></a>00045                         }
<a name="l00056"></a><a class="code" href="classUtil.html#a8d52322a903b653dc2866a49114c2832">00056</a>                         <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="classUtil.html#a8d52322a903b653dc2866a49114c2832" title="Function for calculating distance between 2 3D-points.">dist</a>(<span class="keywordtype">double</span> x1, <span class="keywordtype">double</span> y1, <span class="keywordtype">double</span> z1, <span class="keywordtype">double</span> x2, <span class="keywordtype">double</span> y2, <span class="keywordtype">double</span> z2)
<a name="l00057"></a>00057                         {
<a name="l00058"></a>00058                                 <span class="keywordflow">return</span> sqrt( pow( (x2 - x1), 2) + pow( (y2 - y1), 2) + pow( (z2 - z1), 2) );
<a name="l00059"></a>00059                         }
<a name="l00060"></a>00060 };
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
</td></tr></table>

<hr size="1"><div style="align: right;">
<a href="http://ros.org/wiki/par_kinematics">par_kinematics</a><br />
Author(s): Wouter van Teijlingen</br />
<small>autogenerated on Mon Jun 13 2011 17:06:55</small>
</div>
</body>
</html>
